home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / vudu31q.zip / VUDEMO.BAS < prev    next >
BASIC Source File  |  1992-06-07  |  21KB  |  684 lines

  1. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2. '*             VUDEMO.BAS - VUDU Windows Demonstration Program               *
  3. '*                                                                           *
  4. '*                               Binary Systems                              *
  5. '*                               PO BOX 10714                                *
  6. '*                               FARGO, ND  58106                            *
  7. '*                               (701) 281-2732                              *
  8. '*                                                                           *
  9. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  10.  
  11. '$INCLUDE: 'VUDU.INC'
  12.  
  13. DECLARE SUB datedemo ()
  14. DECLARE SUB overview ()
  15. DECLARE SUB printdemo ()
  16. DECLARE SUB randomtest ()
  17. DECLARE SUB randscroll ()
  18. DECLARE SUB windowdemo ()
  19. DECLARE SUB windows ()
  20. DECLARE SUB infielddemo ()
  21. DECLARE SUB messagedemo ()
  22. DECLARE SUB scrolldemo ()
  23. DECLARE SUB bardemo ()
  24. DECLARE SUB begin ()
  25.  
  26.  
  27. DEFINT A-Z
  28. CONST HEADLINE = "VUDU Windows Version 3.01 for QuickBASIC and PDS 7 ∙ Demo Program"
  29. DIM SHARED background AS STRING
  30. DIM lin(1 TO 3) AS STRING
  31.  
  32. ' Attributes For Window Interactive Demo
  33. DIM SHARED oldrow   AS INTEGER, oldcol   AS INTEGER
  34. DIM SHARED oldwfg   AS INTEGER, oldwbg   AS INTEGER
  35. DIM SHARED oldhedfg AS INTEGER, oldhedbg AS INTEGER
  36. DIM SHARED oldshad  AS INTEGER, oldedge  AS INTEGER
  37.  
  38. ' Type For INFIELD Specifications
  39. TYPE fieldtype
  40.      row AS INTEGER
  41.      Col AS INTEGER
  42.      lng AS INTEGER
  43. END TYPE
  44.  
  45. 'Main Proc
  46.     VINIT   ' call VINIT before executing any VUDU statements
  47.        
  48.     ' Setting the default values for the 'stretchy box' demo
  49.     oldrow = 22: oldcol = 76
  50.     oldhedfg = 15: oldhedbg = 1
  51.     oldwfg = 15: oldwbg = 1
  52.     oldshad = NO: oldedge = 2
  53.  
  54.     FirstLet = CM(YEL + BRITE, WHT + BRITE + FLASH)
  55.     LabelPos = RIGHT
  56.    
  57.     LOCATE , , 0                    'Cursor off
  58.     SCREEN 0: WIDTH 80, 25          '25x80 text mode
  59.   
  60.     ' This is the whole program?
  61.     SAVSCREEN scr$
  62.     begin
  63.     RESCREEN scr$
  64.  
  65.     lin(1) = "    For ordering information, type out the file 'README'"
  66.     lin(2) = " Thank you for viewing VUDU Window Demo by Binary Systems."
  67.     lin(3) = "              Good night and drive safely."
  68.     DEFWIN 0, 0, 0, 3, 0, 3, THIN, YES
  69.     a$ = MESSAGE(r, c, "", lin(), "", 10, YES)
  70.  
  71.     PRINTS SPACE$(80), 25, 1, 0
  72.     LOCATE 25, 1, 1
  73.  
  74. END
  75.  
  76.  
  77.  
  78. ' DATADATADATA - I Like To Keep My DATA Down Out Of The Way - DATADATADATA
  79.  
  80. menudata:
  81. DATA Windows Overview, Windows Demonstration
  82. DATA Barmenu Function Demo, ScrollMenu Function Demo
  83. DATA Message Function Demo, Infield Function Demo, DatIn Demo
  84. DATA Print Routines
  85. DATA Random Pattern Generator,Random Scroll,Exit To Dos
  86.  
  87.  
  88. barmenudata:
  89. DATA Parameters
  90. DATA The barmenu function  accepts two arrays
  91. DATA as  parameters.  The first  contains the
  92. DATA heading  names that  will  appear  above
  93. DATA their  respective menu.  The second is a
  94. DATA two dimensional  array  to  contain  the
  95. DATA lists of items which  appear under their
  96. DATA respective headings.,,,,,,,,,,,,,,
  97.  
  98. DATA Headings
  99. DATA You may pass as many menu  headings
  100. DATA as  you can  fit on  the  menu bar.
  101. DATA you may  also pass  up to  22 items
  102. DATA for each heading without shadows or
  103. DATA 21  if you prefer shadows.  Barmenu
  104. DATA returns  the  subscript  chosen and
  105. DATA key  the  user  entered to  escape.,,,,,,,,,,,,,,
  106.  
  107. DATA Sizing
  108. DATA The function automatically sizes
  109. DATA everthing for you.  The  headers
  110. DATA are spaced and the widths of the
  111. DATA windows are set according to the
  112. DATA widest item element.  The header
  113. DATA bar filler character is variable
  114. DATA to suit different styles.,,,,,,,,,,,,,,
  115.  
  116. DATA Auto-adjust
  117. DATA If you like your menu choices to be  extremely descriptive -
  118. DATA no problem!  The bar menu function will automatically adjust
  119. DATA your sub-menu to fit asthetically under the menu label.   So
  120. DATA use the whole screen if you wish!  Hit ESC or ENTER for menu.
  121. DATA Line 5
  122. DATA Line 6
  123. DATA Line 7
  124. DATA Line 8
  125. DATA Line 9
  126. DATA Line 10
  127. DATA Line 11
  128. DATA Line 12
  129. DATA Line 13
  130. DATA Line 14
  131. DATA Line 15
  132. DATA Line 16
  133. DATA Line 17
  134. DATA Line 18
  135. DATA Line 19
  136. DATA Line 20
  137. DATA Line 21
  138.  
  139. scrolldata:
  140. DATA The scrollmenu function allows the user to choose from a list
  141. DATA of items which would not normally fit within the boundaries
  142. DATA of a window.  The list may be as long as needed and the window
  143. DATA may be as short as needed (minimum of one line).
  144. DATA "                                                        MORE "
  145. DATA "     Scrolling of one full window length is done with the PgUp"
  146. DATA and PgDn keys.  the up and down cursor keys allow moving one
  147. DATA line at a time.
  148. DATA " "
  149. DATA "     The following is a demonstration of choosing an item from"
  150. DATA the scrollmenu list.            Press <ENTER> to continue
  151.  
  152. fielddata:
  153. DATA 14,13,17, 14,36,10, 14,52,17
  154. DATA 16,13,17, 16,36,10, 16,52,17
  155.  
  156. SUB bardemo
  157.    DIM headers(1 TO 4) AS STRING
  158.    DIM Items(1 TO 4, 1 TO 21) AS STRING
  159.    DIM scr AS STRING, retrn  AS STRING
  160.  
  161.    RESTORE barmenudata
  162.    FOR x = 1 TO 4
  163.        READ headers(x)
  164.        FOR y = 1 TO 21
  165.        READ Items(x, y)
  166.        NEXT y
  167.    NEXT x
  168.    
  169.    RESCREEN background
  170.  
  171.    DEFWIN 0, 0, 15, 3, 0, 3, THIN, YES
  172.    DEFBAR 0, 7, 205, NO
  173.  
  174.    baron = NO
  175.    retrn = BARMENU(headers(), Items(), m, i)
  176.    SELECT CASE retrn
  177.      CASE ESC: retrn = "n escape keypress"
  178.      CASE CR: retrn = " carriage return"
  179.    END SELECT
  180.  
  181.    DIM Msg(1 TO 1) AS STRING
  182.    Msg(1) = "You exited with a" + retrn
  183.    Msg(1) = Msg(1) + " and chose menu" + STR$(m) + ", item" + STR$(i) + "."
  184.    DEFWIN 15, 0, 15, 4, 14, 4, THIN, YES
  185.    Msg(1) = MESSAGE(14, c, "Message Box", Msg(), "", 5, YES)
  186.    
  187. END SUB
  188.  
  189. SUB begin
  190.     DIM win AS STRING, bar AS STRING, raise AS STRING
  191.     DIM fg AS INTEGER, bg AS INTEGER
  192.     DIM lin(1 TO 12) AS STRING
  193.     DIM clr AS STRING, vid AS STRING
  194.  
  195.     'Create Opening Screen
  196.     DEFWIN 0, 0, 7, 1, 7, 1, NONE, NO
  197.     OPENWIN 1, 1, 25, 80, ""
  198.    
  199.     'Lightning!
  200.     w$ = STRING$(15, 219)
  201.     var = 56
  202.     FOR x = 1 TO 25
  203.        IF x MOD 7 = 0 THEN var = var + 10
  204.        IF x > 21 THEN w$ = LEFT$(w$, LEN(w$) - 3)
  205.        IF x = 25 THEN var = var + 1
  206.        IF x < 25 THEN HILITE x + 1, var - x * 3 + 1, LEN(w$), 8
  207.        PRINTS w$, x, var - x * 3, CM(14, 7)
  208.     NEXT x
  209.    
  210.     'Print Bottom Bar Labels
  211.     PRINTS SPACE$(80), 1, 1, ATTRIB(WHT + BRITE, MAG)
  212.     PRINTS HEADLINE, 1, 40 - LEN(HEADLINE) / 2, 0
  213.    
  214.  
  215.     'laser sound effect
  216.      PLAY "mf"
  217.      FOR x = 10000 TO 37 STEP -100
  218.      SOUND x \ 2, .03
  219.      SOUND x, .07
  220.      NEXT x
  221.  
  222.     ' ***********************  FIRST WINDOW  ***************************
  223.     lin(1) = "  V U D U   W I N D O W S   Version 3.01  By Binary Systems"
  224.     lin(2) = "    User interface and display tools for Microsoft BASICs"
  225.     lin(3) = " "
  226.     lin(4) = "       Press Any Key For The Demonstration Program "
  227.     
  228.     DEFWIN 15, 4, 15, 4, 14, 4, PAIR, YES
  229.     w$ = MESSAGE(r, c, "", lin(), "", 300, YES)
  230.  
  231.  
  232.     ' **********************  SECOND MESSAGE  ***************************
  233.     'message window describing VUDU
  234.     lin(1) = "VUDU (Very Useful Display Utilities) features:"
  235.     lin(2) = "      Built in mouse support and mouse procedures"
  236.     lin(3) = "      Automatic sensing of the active video page"
  237.     lin(4) = "      Automatic sensing of monochrome/color card"
  238.     lin(5) = "      Optional auto-centering for all windows"
  239.     lin(6) = "      Auto snow elimination on CGA systems"
  240.     lin(7) = "      Easy customization"
  241.     DEFWIN 15, 4, 15, 4, 14, 4, PAIR, YES
  242.     a$ = MESSAGE(0, 0, "The VUDU Windows", lin(), "", 15, YES)
  243.    
  244.    
  245.     ' Print VIDEO INFORMATION
  246.     REDIM lin(1 TO 12) AS STRING
  247.     SELECT CASE VIDCARD
  248.      CASE MONO: lin(1) = "MonoChrome"
  249.      CASE CGA:  lin(1) = "CGA"
  250.      CASE EGA:  lin(1) = "EGA"
  251.      CASE VGA:  lin(1) = "VGA"
  252.     END SELECT
  253.     lin(1) = lin(1) + " Video Card Detected"
  254.     IF Vmouse THEN
  255.        lin(2) = "Mouse is active"
  256.     ELSE
  257.        lin(2) = "Mouse not installed"
  258.     END IF